<?php

$data = array('msg' => null, 'type' => 'orderdetail', 'table' => 'order_detail', 's_title' => 'Purchase Order', 'p_title' => 'Purchase Orders');

$data['fields'] = array(
    'item' => array('field' => 'item', 'title' => 'Nº', 'type' => 'label', 'search' => '`order_detail`.`item`'),
    'quantity' => array('field' => 'quantity', 'title' => 'Qty', 'type' => 'label', 'search' => '`order_detail`.`quantity`'),
    'category_id' => array('field' => 'category_id', 'title' => 'Type', 'type' => 'list', 'search' => '`categories`.`category`'),
    'manufacturer_id' => array('field' => 'manufacturer_id', 'title' => 'Manufacturer', 'type' => 'list', 'search' => '`manufacturers`.`manufacturer`'),
    'model_id' => array('field' => 'model_id', 'title' => 'Model', 'type' => 'list', 'search' => '`models`.`model`'),
    'warranty_p_id' => array('field' => 'warranty_p_id', 'title' => 'Provider Wty', 'type' => 'list-mixed', 'search' => '`warranty_p`'),
    'warranty_m_id' => array('field' => 'warranty_m_id', 'title' => 'Manufacturer Wty', 'type' => 'list-mixed', 'search' => '`warranty_m`')
);
$data['joins'] = array(
    'orders',
    'categories',
    'manufacturers',
    'models',
    'warranties AS warranties_p',
    'warranties AS warranties_m',
    'measures AS measures_p',
    'measures AS measures_m'
);
$data['join_fields'] = array(
    '`order_detail`.`order_id`=`orders`.`id`',
    '`order_detail`.`model_id`=`models`.`id`',
    '`models`.`manufacturer_id`=`manufacturers`.`id`',
    '`manufacturers`.`category_id`=`categories`.`id`',
    '`order_detail`.`warranty_p_id`=`warranties_p`.`id`',
    '`warranties_p`.`measure_id`=`measures_p`.`id`',
    '`order_detail`.`warranty_m_id`=`warranties_m`.`id`',
    '`warranties_m`.`measure_id`=`measures_m`.`id`'
);
$data['alias'] = array(
    '*',
    'CONCAT(`warranties_p`.`warranty`,\' \',`measures_p`.`measure` ) AS `warranty_p`',
    'CONCAT(`warranties_m`.`warranty`,\' \',`measures_m`.`measure` ) AS `warranty_m`'
);
$data['where'] = array(
    'order' => '`order_id`='
);
?>
